package com.itheima.controller;

import com.itheima.feign.UserFeign;
import com.itheima.pojo.User;
import com.netflix.discovery.converters.Auto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/feign")
public class ConsumerFeignController {
    @Autowired
    private UserFeign userFeign;

    @RequestMapping("/{id}")
    public User findById(@PathVariable("id") Integer id) {
        User user = userFeign.findById(id);
        return user;
    }
}
